package com.patttern.behavior.observer;

/**
 * @Author: root
 * @Date: 2018/12/3 21:04
 */
public class Client {
    public static void main(String[] args) {
        SubjectA subjectA = new SubjectA();
        ObserverA obs1 = new ObserverA();
        ObserverA obs2 = new ObserverA();
        ObserverA obs3 = new ObserverA();
        subjectA.addObserver(obs1);
        subjectA.addObserver(obs2);
        subjectA.addObserver(obs3);
        subjectA.setState(100);
        System.out.println("==============");
        System.out.println(obs1.getMyState());
        System.out.println(obs2.getMyState());
        System.out.println(obs3.getMyState());
    }
}
